import { ApiProperty } from '@nestjs/swagger'
import { IsNotEmpty, IsNumber, IsOptional, IsString, MaxLength } from 'class-validator'

export class CreateAwardDto {
  @ApiProperty({ description: '员工ID', example: 1 })
  @IsNumber({}, { message: '员工ID必须为数字' })
  @IsNotEmpty({ message: '员工ID不能为空' })
  staffId: number
  @ApiProperty({ description: '奖惩规则ID', example: 1 })
  @IsNumber({}, { message: '奖惩规则ID必须为数字' })
  @IsNotEmpty({ message: '奖惩规则ID不能为空' })
  awardRuleId: number
  @ApiProperty({ description: '描述', example: '描述' })
  @IsOptional()
  @IsString({ message: '描述必须为字符串' })
  @MaxLength(50, { message: '描述最长为50个字符' })
  desc?: string
}
